package com.normalClasses.eye;

import java.sql.Date;
import java.text.SimpleDateFormat;
import freemarker.core.ParseException;

public class userBehavior {
  private String timeStamp;
  private String information;
  private double weight;
  public userBehavior(String timeStamp, String information, double weight) {
    this.timeStamp=timeStamp;
    this.information=information;
    this.weight=weight;
  }

  /**
   * helper function used to transform Date to stamp
   * @param s - Date
   * @return - time stamp
   * @throws ParseException
   */
private static String dateToStamp(String s) throws ParseException{
    String res;
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.sss");
    Date date=null;
    try{
      date = (Date) simpleDateFormat.parse(s);
    } catch (java.text.ParseException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    long ts = date.getTime();
    res = String.valueOf(ts);
    return res;
}
  
 public void setTimeStamp(String Date){
    try{
      this.timeStamp=this.dateToStamp(Date);
    } catch (ParseException e) {
      e.printStackTrace();
    }
  }
  public String getTimeStamp() {
      return this.timeStamp;
    }
  public void setInformation(String information) {
    this.information=information;
  }
  public String getInformation() {
    return this.information;
  }
  public void setWeight(float weight) {
    this.weight=weight;
    
}
  public double getWeight(){
    return this.weight;
  }

 


}
